<!DOCTYPE html>
<html>
    <head>
        <meta charset='utf-8'>
        <applet code="nano" archive="/../../../common/vendor/benchmarkjs/nano.jar" style="display: none;"></applet>
        <script type='text/javascript' src="../../../common/vendor/benchmarkjs/benchmark.js"></script>
    </head>

    <body class='yui3-skin-sam'>

        <p><button id="start">Start Benchmarks against Local YUI</button></p>
        <div id="log"></div>
        <script src="../../../../build/yui/yui.js"></script>
        <script src="axis-benchmark.js"></script>
        <script>

            YUI({
                'axis-benchmark': {
                    fullpath: 'axis-benchmark.js',
                    requires: ['charts']
                },
                defaultGraphicEngine: (window.location.search.match(/[?&]defaultGraphicEngine=([^&]+)/) || [])[1] || 'svg',
				filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw',
                useBrowserConsole: false
            }).use('charts', 'axis-benchmark', 'test-console', function (Y) {

                var suite = Y.BenchmarkSuite,
                    start = Y.one('#start');

                suite.on('start', function () {
                    start.set('disabled', true);
                    Y.log('Starting benchmarks.', 'status', 'benchmark');
                });

                suite.on('cycle', function (e) {
                    Y.log(String(e.target), 'info', 'benchmark');
                });

                suite.on('complete', function () {
                    start.set('disabled', false);
                    Y.log('Finished.', 'status', 'benchmark');
                });

                start.on('click', function () {
                    suite.run({async: true});
                });

                new Y.Test.Console({render: '#log'}).filter.setAttrs({
                    'category.fail'    : false,
                    'category.status'  : true,
                    'source.benchmark' : true,
                    'source.TestRunner': false
                });
            });

        </script>
    </body>
</html>
